import { mergeConfig } from 'vite';
import baseConfig from './vite.config.base';

const target = 'http://bzsite.dev.proxima-ai.com/ry';
const target_dev = 'http://bzsite.dev.proxima-ai.com';
const target_dev88 = "http://bzsite.dev.proxima-ai.com:88";
const target_test = "http://bzsite.test.proxima-ai.com";
const target_test88 = "http://bzsite.test.proxima-ai.com:88";
export default mergeConfig(
  {
    mode: 'development',
    server: {
      open: true,
      fs: {
        strict: true,
      },
      port: 3002,
      proxy: {
        '/api/deepzoom': {
          target: target_dev88,
          changeOrigin: true,
          rewrite: (path: string) => path.replace(/^\/api/, ''),
        },
        '/api': {
          target: target,
          changeOrigin: true,
          rewrite: (path: string) => path.replace(/^\/api/, ''),
        },
        "/aaa": {
          target: target + '/aaa',
          changeOrigin: true,
          rewrite: (path: string) => {
            return path.replace(/^\/aaa/, '');
          }
        },
        '/config': {
          target: target,
          changeOrigin: true,
          rewrite: (path: string) => {
            return path.replace(/^\/config/, '');
          }
        },
      },
    },
    plugins: [
      // eslint({
      //   cache: false,
      //   include: ['src/**/*.ts', 'src/**/*.tsx', 'src/**/*.vue'],
      //   exclude: ['node_modules'],
      // }),
    ],
  },
  baseConfig
);
